﻿using System.Collections.Generic;
using System.Linq;

namespace Sidvall.Reporting
{
    public class ParameterCollection : System.Collections.ObjectModel.Collection<Parameter>
    {
        #region Public Members

        #region Add

        public void Add(string name, object value)
        {
            var item = new Parameter()
            {
                Name = name,
                Value = value,
            };
            Add(item);
        }

        #endregion
        #region AddRange

        public void AddRange(params Parameter[] items)
        {
            AddRange(items.AsEnumerable());
        }
        public void AddRange(IEnumerable<Parameter> items)
        {
            if (items == null)
                return;
            foreach (var item in items)
            {
                if (item != null)
                    Add(item);
            }
        }

        #endregion

        #endregion
    }
}
